<?php
/**
 * Created by IntelliJ IDEA.
 * User: keke
 * Date: 18-10-28
 * Time: 下午2:58
 */
require_once "../congfig/config.php";
require_once "../lib/common.php";
$uid = $_GET['uid'];
if(!is_numeric($uid)){
    exit(jsoncall(-1,"请勿恶意修改"));
}
$sql="SELECT * FROM `users` WHERE uid='$uid'";
$query = $conn->query($sql);
$result = $query->fetch_array();
$username = $result['username'];
$sql="SELECT * FROM `proinfor` WHERE pChar='$username'";
$query = $conn->query($sql);
$num = $query->num_rows;
if($num)
{
    exit(jsoncall(-1,"不可删除项目负责人"));
}
$sql = "DELETE FROM puser WHERE  uid = '$uid'";
$query = $conn->query($sql);
if ($query) {
    exit(jsoncall(1, "删除项目成员成功"));
} else {
    exit(jsoncall(-1, "删除项目成员失败"));
}